@import "mixins/index.scss";

/* Button 按钮
------------------------------- */
// 第三方字体图标大小
.el-button:not(.is-circle) i.el-icon,
.el-button i.iconfont,
.el-button i.fa,
.el-button--default i.iconfont,
.el-button--default i.fa {
  font-size: 14px;
  margin-right: 5px;
}

.el-button--small i.iconfont,
.el-button--small i.fa {
  font-size: 12px !important;
  margin-right: 5px;
}

/* Input 输入框、InputNumber 计数器
------------------------------- */
// 菜单搜索
.el-autocomplete-suggestion__wrap {
  max-height: 280px !important;
}

/* Form 表单
------------------------------- */
.el-form {
  // 用于修改弹窗时表单内容间隔太大问题，如系统设置的新增菜单弹窗里的表单内容
  //.el-form-item:last-of-type {
  //	margin-bottom: 0 !important;
  //}
  // 修复行内表单最后一个 el-form-item 位置下移问题
  &.el-form--inline {
    .el-form-item--large.el-form-item:last-of-type {
      margin-bottom: 22px !important;
    }

    .el-form-item--default.el-form-item:last-of-type,
    .el-form-item--small.el-form-item:last-of-type {
      margin-bottom: 18px !important;
    }
  }

  // https://gitee.com/lyt-top/vue-next-admin/issues/I5K1PM
  .el-form-item .el-form-item__label .el-icon {
    margin-right: 0px;
  }
}

/* Alert 警告
------------------------------- */
.el-alert {
  border: 1px solid;
}

.el-alert__title {
  word-break: break-all;
}

/* Message 消息提示
------------------------------- */
.el-message {
  min-width: unset !important;
  padding: 15px !important;
  box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.02);
}

/* Tabs 标签页
------------------------------- */
.el-tabs__nav-wrap::after {
  height: 1px !important;
}

/* Dropdown 下拉菜单
------------------------------- */
.el-dropdown-menu {
  list-style: none !important; /*修复 Dropdown 下拉菜单样式问题 2022.03.04*/
}

.el-dropdown-menu .el-dropdown-menu__item {
  white-space: nowrap;

  &:not(.is-disabled):hover {
    background-color: var(--el-dropdown-menuItem-hover-fill);
    color: var(--el-dropdown-menuItem-hover-color);
  }
}

/* Dialog 对话框
------------------------------- */
.el-overlay {
  //overflow: hidden;

  .el-overlay-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    position: unset !important;
    width: 100%;
    height: 100%;

    // 不包含 is-fullscreen 类名的对话框

    .el-dialog:not(.is-fullscreen) {
      top: 10%;
      margin: 0 auto !important;
      position: absolute;
      border-radius: 10px !important;

      .el-dialog__header {
        margin-right: 0 !important;
        border-bottom: var(--el-border);
      }

      .el-dialog__body {
        padding: var(--el-dialog-padding-primary) !important;
        height: 100%;
        overflow: hidden;
      }
    }

    .full-dialog {
      top: 0 !important;
    }
  }
}

/* Card 卡片
------------------------------- */
.el-card__header {
  padding: 15px 20px;
}

/* Table 表格 element plus 2.2.0 版本
------------------------------- */
.el-table {
  z-index: 10;

  .el-button.is-text {
    padding: 0;
  }
}

/* scrollbar
------------------------------- */
.el-scrollbar__bar {
  z-index: 4;
}

/*防止页面切换时，滚动条高度不变的问题（滚动条高度非滚动条滚动高度）*/
.el-scrollbar__wrap {
  max-height: 100%;
}

.el-select-dropdown .el-scrollbar__wrap {
  overflow-x: scroll !important;
}

/*修复Select 选择器高度问题*/
.el-select-dropdown__wrap {
  max-height: 274px !important;
}

/*修复Cascader 级联选择器高度问题*/
.el-cascader-menu__wrap.el-scrollbar__wrap {
  height: 204px !important;
}

/*用于界面高度自适应（main.vue），区分 scrollbar__view，防止其它使用 scrollbar 的地方出现滚动条消失*/
.layout-container-view .el-scrollbar__view {
  height: 100%;
}

/*防止分栏布局二级菜单很多时，滚动条消失问题*/
.layout-columns-warp .layout-aside .el-scrollbar__view {
  height: unset !important;
}

/* Pagination 分页
------------------------------- */
.el-pagination__editor {
  margin-right: 8px;
}

/*深色模式时分页高亮问题*/
.el-pagination.is-background .btn-next.is-active,
.el-pagination.is-background .btn-prev.is-active,
.el-pagination.is-background .el-pager li.is-active {
  background-color: var(--el-color-primary) !important;
  color: var(--el-color-white) !important;
}

/* Drawer 抽屉
------------------------------- */
.el-drawer {
  --el-drawer-padding-primary: unset !important;

  .el-drawer__header {
    padding: 0 15px !important;
    height: 50px;
    display: flex;
    align-items: center;
    margin-bottom: 0 !important;
    border-bottom: 1px solid var(--el-border-color);
    color: var(--el-text-color-primary);
  }

  .el-drawer__body {
    width: 100%;
    height: 100%;
    overflow: auto;
  }
}

// 自定义文字提示弹窗
.el-popper.is-tduck {
  /* Set padding to ensure the height is 32px */
  padding: 6px 12px;
  background: #ededfb;
}

.el-popper.is-tduck .el-popper__arrow::before {
  background: #ededfb;
  right: 0;
}

.select-width {
  width: 240px !important;
}

.el-form--inline {
  .el-form-item {
    & > .el-input, .el-cascader, .el-select, .el-date-editor, .el-autocomplete {
      width: 240px;
    }
  }
}

.el-message-box {
  --el-messagebox-border-radius: 6px;
}
